﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/AdminToolM.master" AutoEventWireup="true" CodeBehind="CoursesTool.aspx.cs" Inherits="UnwiseSource.Administration.CoursesTool" %>
<asp:Content ID="Content1" ContentPlaceHolderID="tools_body" runat="server">
    <link href="AStyles/coursesTool-style.css" rel="stylesheet" />
    <div id="content-holder">
        <div>
            <div class="tool_header_holder">
                <h1>Курсове</h1>
                <ul id="courses_btns">
                    <li>
                        <label for="cb_SeeEndedCourses">Показвай завършили:</label>  
                        <input type="checkbox" id="cb_SeeEndedCourses" checked="checked" onclick="EndedCoursesShowHide(event)"/>
                    </li>
                    <li>
                        <asp:LinkButton ID="btnNewCourse" OnClick="btnNewCourse_Click" runat="server" ToolTip="Създай Курс">
                            <%--<img id="addBtn" src="../Resources/Images/AddBtnGreen.png" />--%>
                        </asp:LinkButton>
                    </li>
                </ul>
            </div>

            <ul>
                <%--here will stay the icon buttons--%>
            </ul>
        </div>

        <div ID="CoursesHolder" class="course_elements_holder" runat="server">

            <%--<table cellspacing="5" cellpadding="0">
                <tr>
                    <td>
                        <article class="course_element">
                            <h1>Основи на Web програмирането с JavaScript</h1>
                            <ul>
                                <li>Създаден:
                                    <span class="created">19.22.2013</span>
                                </li>
                                <li>Създател:
                                    <span class="creator">astian</span>
                                </li>
                                <li>Редактиран:
                                    <span class="modified">21.22.2013</span>
                                </li>
                                <li>Редактирал:
                                    <span class="modifier">astian</span>
                                </li>
                            </ul>

                            <div class="element_btns_holder">
                                <p>Брой лекции: <span>12</span></p>
                                <a href="#">Редактирай</a>
                                <a href="#">Изтрий</a>
                            </div>
                        </article>
                    </td>
                    <td>
                        <article class="course_element">
                            <h1>Основи на Web програмирането с JavaScript</h1>
                            <ul>
                                <li>Създаден:
                                    <span class="created">19.22.2013</span>
                                </li>
                                <li>Създател:
                                    <span class="creator">astian</span>
                                </li>
                                <li>Редактиран:
                                    <span class="modified">21.22.2013</span>
                                </li>
                                <li>Редактирал:
                                    <span class="modifier">astian</span>
                                </li>
                            </ul>

                            <div class="element_btns_holder">
                                <p>Брой лекции: <span>12</span></p>
                                <a href="#">Редактирай</a>
                                <a href="#">Изтрий</a>
                            </div>
                        </article>
                    </td>
                </tr>
                <tr>
                    <td>
                        <article class="course_element">
                            <h1>Основи на Web програмирането с JavaScript</h1>
                            <ul>
                                <li>Създаден:
                                    <span class="created">19.22.2013</span>
                                </li>
                                <li>Създател:
                                    <span class="creator">astian</span>
                                </li>
                                <li>Редактиран:
                                    <span class="modified">21.22.2013</span>
                                </li>
                                <li>Редактирал:
                                    <span class="modifier">astian</span>
                                </li>
                            </ul>

                            <div class="element_btns_holder">
                                <p>Брой лекции: <span>12</span></p>
                                <a href="#">Редактирай</a>
                                <a href="#">Изтрий</a>
                            </div>
                        </article>
                    </td>
                </tr>
            </table>--%>
            

        </div>
        <script src="../Libraries/jquery-2.0.3.js"></script>
        <script>
            function EndedCoursesShowHide(event) {
                var cbSeeEndedCourses = $("#cb_SeeEndedCourses");
                var showEnded = cbSeeEndedCourses.is(":checked");

                var courses = $(".course_element");
                courses.each(function () {
                    var span = $(this).find(".endedSpan");
                    var textValue = span.text();
                    
                    if (textValue == "Да") {
                        if (showEnded == true) {
                            $(this).css({ 'display': 'inline-block' });
                        }
                        else {
                            $(this).css({ 'display': 'none' });
                        }
                    }

                });
            }
        </script>
    </div>

</asp:Content>
